//
//  NWESSRequest.m
//  KuWoCan
//
//  Created by hwd on 17/3/24.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "NWESSRequest.h"
// Enters saves sells 进存销管理请求


@implementation NWESSRequest

//获取用户进销数据接口

/*userId	string	是	用户Id	3ab9a17cb54141c0b0b747fd0a219394
 pageNo	string	是	分页参数，第几页	1
 pageSize	string	是	分页参数，每页显示多少条	1*/

- (void)startRequestGetESSListWithUserId:(NSString *)userId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize
{
    _showError = YES;
    _showLoading = YES;
    _path = NWESSGetAll_Path;
    
    NSMutableDictionary *dic = [[NSMutableDictionary alloc]initWithDictionary:@{@"userId":userId,@"pageNo":pageNo,@"pageSize":pageSize}];
    _params = dic;
    [self startPost];
}

//根据进销Id查询进销详情

- (void)startRequestGetESSDetailWithInvoicingId:(NSString *)invoicingId
{
    _showError = YES;
    _showLoading = YES;
    _path = NWESSGetESSDetail_Path;
    
    NSMutableDictionary *dic = [[NSMutableDictionary alloc]initWithDictionary:@{@"invoicingId":invoicingId}];
    _params = dic;
    [self startPost];
}

//产品列表接口

- (void)startRequestGetKWProduct
{
    _showError = YES;
    _showLoading = YES;
    _path = NWGetKWProduct_Path;
    [self startGet];
}


//初始化库存接口

- (void)startRequestInitInventoryWithUserId:(NSString *)userId data:(NSString *)data
{
    _showError = YES;
    _showLoading = YES;
    _path = NWESSInitInventory_Path;
    
    NSMutableDictionary *dic = [[NSMutableDictionary alloc]initWithDictionary:@{@"userId":userId,@"data":data}];
    _params = dic;
    [self startPost];
}

//根据用户Id获取当前库存产品
- (void)startRequestGetInventoryWithUserId:(NSString *)userId
{
    _showError = YES;
    _showLoading = YES;
    _path = NWESSGetInventory_Path;
    
    NSMutableDictionary *dic = [[NSMutableDictionary alloc]initWithDictionary:@{@"userId":userId}];
    _params = dic;
    [self startPost];
}

//判断是否可以更新库存接口
- (void)startRequestCanUpdateInventoryWithUserId:(NSString *)userId
{
    _showError = YES;
    _showLoading = YES;
    self.isNotDataStr = YES;
    _path = NWESSCanUpdateInventory_Path;
    
    NSMutableDictionary *dic = [[NSMutableDictionary alloc]initWithDictionary:@{@"userId":userId}];
    _params = dic;
    [self startPost];
}

//更新库存接口
- (void)startRequestUpdateInventoryWithUserId:(NSString *)userId data:(NSString *)data
{
    _showError = YES;
    _showLoading = YES;
    _path = NWESSUpdateInventory_Path;
    
    NSMutableDictionary *dic = [[NSMutableDictionary alloc]initWithDictionary:@{@"userId":userId,@"data":data}];
    _params = dic;
    [self startPost];
}

@end
